package com.usts236.exam5;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

import db.DBHelper;

public class MainActivity extends AppCompatActivity {
private Context mContext ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //依靠DatabaseHelper带全部参数的构造函数创建数据库



        setContentView(R.layout.activity_main);
        FragmentManager fm = getSupportFragmentManager();
        Fragment fragment = fm.findFragmentById(R.id.fragment_list);
        if (fragment == null) {
            fragment = new ListFragment();
            fm.beginTransaction()
                    .add(R.id.fragment_list, fragment)
                    .commit();
        }
    }
}